window.onload= function () {


     /*1.页面初始化*/
     var username="mat";
    var usernameSpan=  document.getElementById('username');
    usernameSpan.innerText = username;


    /*
     *  2. 事件绑定
    * */

    var btnJump = document.getElementById('btnJump');
    var btnAdd = document.getElementById('btnAdd');
    var slt = document.getElementById('slt');

  /*  btnJump.onclick = function () {

    }

    btnAdd.onclick = function () {

    }*/

    btnJump.onclick =btnJumpClick;
    btnAdd.onclick = btnAddClick;

    slt.onchange=sltChange;

}

function btnJumpClick() {
    alert('jump')
}

function btnAddClick() {
   alert('add');
}

function sltChange(){

    var selectOption = this.selectedOptions[0];
    /*{
          vaule:1，
          text:'北京'
       }
    * */
   var selectedValue= this.selectedOptions[0].value;
   var selectedText= this.selectedOptions[0].text;
   alert(selectedValue);
    alert(selectedText);

   console.log(this.selectedOptions[0]);

}